<script setup>
import { ref } from "vue";
import { useRouter } from "vue-router";
const router = useRouter();
const handleExit = () => {
  localStorage.removeItem('token');
  router.replace('/login');
};
</script>

<template>
  <div class="header-wrapper">
    <router-link to="/home" style="text-decoration: none;font-weight: bold;color: #666666">xx科技有限公司</router-link>
    <div class="user-info">
      <el-dropdown>
        <span class="dropdown-trigger">
          <el-avatar src="https://picsum.photos/id/1005/200/200"></el-avatar>
        </span>
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item @click="handleExit">退出登录</el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
    </div>
  </div>
</template>

<style scoped>
.header-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}
.user-info {
  display: flex;
  align-items: center;
}
</style>
